import java.io.File;
import java.util.Scanner;

/**
 * IDE: Eclipse
 *
 * @author Justin Niles
 * @author Grant Foster
 * @author Bryce Langlotz
 * @author Max Honosky
 *
 */
public class FileReader
{
    public static AtomArray getAtoms()
    {
        String FILE_PATH = Main.inputFilePath;
        final AtomArray atomArray = new AtomArray();

        Scanner scanner;
        try
        {
            scanner = new Scanner(new File(FILE_PATH));
            while (scanner.hasNext())
            {
                Atom atom = new Atom();
                for (int i = 1; i <= 10; i++)
                {
                    String temp = scanner.next();
                    if (i == 6)
                    {
                        atom.xPos = Float.parseFloat(temp);
                    }
                    if (i == 7)
                    {
                        atom.yPos = Float.parseFloat(temp);
                    }
                    if (i == 8)
                    {
                        atom.zPos = Float.parseFloat(temp);
                    }
                    if (i == 10)
                    {
                        atom.radius = Float.parseFloat(temp);
                    }
                }
                atomArray.add(atom);
            }
            scanner.close();
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return atomArray;
    }
}